<template>
  <el-pagination
    class="pagination"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
    :current-page="forms.pageNo"
    :page-sizes="[10, 20, 30, 40, 50, 100]"
    :page-size="forms.limit"
    layout="total, sizes, prev, pager, next, jumper"
    :total="forms.total"
  ></el-pagination>
</template>

<script>
export default {
  props: {
  forms:{type: Object, required: true},
  gain:{type: Function, required: true}
}, //父传子的数组
  data() {
    return {};
  },
  methods: {
    //当前条数
    handleSizeChange(val) {
      this.forms.limit = val;
      this.gain(); //渲染接口
    },
    //当前页码
    handleCurrentChange(val) {
      this.forms.pageNo = val;
      this.gain(); //渲染接口
    }
  }
};
</script>

<style scoped="scoped">
.el-select .el-input .el-select__caret {
  position: absolute;
  right: 195px;
}
</style>
